﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL = Auto.Data.BusMan.BLL;
using Model = Auto.Data.BusMan.Model;
using Auto.Components;

namespace Auto.BusMan.AddForm
{
    public partial class fmCarBreakRuleAddForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitPage();
            }
        }

        private void InitPage()
        {
            string docID = Request.QueryString["DocID"];
            BindData(docID);
        }

        private void BindData(string docID)
        {
            BLL.BusBreakRules bll = new BLL.BusBreakRules();
            Model.BusBreakRules model = bll.GetModel(docID);


            this.lblCompanyName.Text = model.CompanyName;

            BLL.BusList bllBusList = new BLL.BusList();
            Model.BusList modelBusList = bllBusList.GetModel(model.BusID);
            this.lblBusIdentificationNO.Text = modelBusList.BusIdentificationNO;

            this.lblDriverName.Text = model.DriverName;
            this.lblBreakRuleTime.Text = model.BreakRuleTime.ToString("yyyy-MM-dd");

            this.ucPhraseBreakRuleLabel.Text = model.BreakRuleType;
            this.lblBreakRuleLocation.Text = model.BreakRuleLocation;
            this.lblBreakRuleNote.Text = model.BreakRuleNote;
            this.lblForfeit.Text = model.Forfeit.ToString();
            



        }

    }
}